package UnOfficeDeTourisme;

/**
 * Interface definition : Carte
 * 
 * @author OpenORB Compiler
 */
public class _CarteStub extends org.omg.CORBA.portable.ObjectImpl
        implements Carte
{
    static final String[] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/Carte:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = UnOfficeDeTourisme.CarteOperations.class;

    /**
     * Read accessor for idCarte attribute
     * @return the attribute value
     */
    public int idCarte()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_idCarte",true);
                    _input = this._invoke(_output);
                    return _input.read_long();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_idCarte",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CarteOperations _self = (UnOfficeDeTourisme.CarteOperations) _so.servant;
                try
                {
                    return _self.idCarte();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Read accessor for dateValidite attribute
     * @return the attribute value
     */
    public UnOfficeDeTourisme.datecut dateValidite()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_dateValidite",true);
                    _input = this._invoke(_output);
                    return UnOfficeDeTourisme.datecutHelper.read(_input);
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_dateValidite",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CarteOperations _self = (UnOfficeDeTourisme.CarteOperations) _so.servant;
                try
                {
                    return _self.dateValidite();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Read accessor for listeDesEntrees attribute
     * @return the attribute value
     */
    public UnOfficeDeTourisme.Entree[] listeDesEntrees()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_listeDesEntrees",true);
                    _input = this._invoke(_output);
                    return UnOfficeDeTourisme.listeEntreesHelper.read(_input);
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_listeDesEntrees",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CarteOperations _self = (UnOfficeDeTourisme.CarteOperations) _so.servant;
                try
                {
                    return _self.listeDesEntrees();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getEntrees
     */
    public UnOfficeDeTourisme.Entree[] getEntrees(int idVisite)
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getEntrees",true);
                    _output.write_long(idVisite);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Entree[] _arg_ret = UnOfficeDeTourisme.listeEntreesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getEntrees",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CarteOperations _self = (UnOfficeDeTourisme.CarteOperations) _so.servant;
                try
                {
                    return _self.getEntrees( idVisite);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation getAllEntrees
     */
    public UnOfficeDeTourisme.Entree[] getAllEntrees()
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("getAllEntrees",true);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Entree[] _arg_ret = UnOfficeDeTourisme.listeEntreesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("getAllEntrees",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CarteOperations _self = (UnOfficeDeTourisme.CarteOperations) _so.servant;
                try
                {
                    return _self.getAllEntrees();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation ajouterEntree
     */
    public void ajouterEntree(UnOfficeDeTourisme.genericEntry[] hmIdEntree)
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("ajouterEntree",true);
                    UnOfficeDeTourisme.hashMapObectId_IORHelper.write(_output,hmIdEntree);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("ajouterEntree",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CarteOperations _self = (UnOfficeDeTourisme.CarteOperations) _so.servant;
                try
                {
                    _self.ajouterEntree( hmIdEntree);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation ajouterPresta
     */
    public void ajouterPresta(UnOfficeDeTourisme.Prestation presta)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("ajouterPresta",true);
                    UnOfficeDeTourisme.PrestationHelper.write(_output,presta);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("ajouterPresta",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CarteOperations _self = (UnOfficeDeTourisme.CarteOperations) _so.servant;
                try
                {
                    _self.ajouterPresta( presta);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation calculerPrixTotalAPayer
     */
    public float calculerPrixTotalAPayer()
        throws UnOfficeDeTourisme.MontantNegatifException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("calculerPrixTotalAPayer",true);
                    _input = this._invoke(_output);
                    float _arg_ret = _input.read_float();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.MontantNegatifExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.MontantNegatifExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("calculerPrixTotalAPayer",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CarteOperations _self = (UnOfficeDeTourisme.CarteOperations) _so.servant;
                try
                {
                    return _self.calculerPrixTotalAPayer();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation dejaVisite
     */
    public boolean dejaVisite(UnOfficeDeTourisme.Visite v)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("dejaVisite",true);
                    UnOfficeDeTourisme.VisiteHelper.write(_output,v);
                    _input = this._invoke(_output);
                    boolean _arg_ret = _input.read_boolean();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("dejaVisite",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.CarteOperations _self = (UnOfficeDeTourisme.CarteOperations) _so.servant;
                try
                {
                    return _self.dejaVisite( v);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
